<template>
  <div>
    <el-pagination
      small
      background
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="value"
      :page-sizes="pageSizes"
      :page-size="pageSize"
      layout="total, sizes, prev, pager, next, jumper"
      :total="total">
    </el-pagination>
  </div>
</template>

<script>
  export default {
    name: 'page',
    props: {
      value: {Number, default: 1},
      pageSize: {Number, default: 10},
      pageSizes: {Array, default: [10, 20, 50, 100, 200, 500]},
      total: {Number, default: 0}
    },
    computed: {
    },
    methods: {
      handleSizeChange() {
        this.$emit('change')
      },
      handleCurrentChange(page) {
        this.$emit('update:value',page)
        this.$emit('change')
      }
    }
  }
</script>

<style scoped lang="scss">
  .small-card {
    ::v-deep .el-card__body {
      padding: 10px;
    }
  }
</style>
